package cn.skyquant.quant4j.jforex.sdk.strategy2;

import cn.skyquant.quant4j.sdk.util.constant.EAConstants;

/**
 * 处理订单的comment
 * @author harley-dog
 * 2019-4-2
 */
public abstract class AbstractComment {
    private boolean valid = false;
    public AbstractComment(){
    }
    public final void init(String comment){
        String[] strs = comment.split(EAConstants.split);
        if(strs==null || strs.length!=getParamNum()){
            valid = false;
        }else {
            valid = parse(strs);
        }
    }
    public boolean isValid() {
        return valid;
    }
    public abstract boolean parse(String[] strs);
    public abstract int getParamNum();

}
